<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8"/>
    <title>添加基本信息 - bjyadmin</title>
    <bootstrapcss />
    <link rel="stylesheet" href="__ADMIN_ACEADMIN__/css/chosen.css" />
    <icheckcss />
</head>
<body>

<!-- 导航栏开始 -->
<div class="bjy-admin-nav">
    <i class="fa fa-home"></i> 首页
    &gt;
    后台管理
    &gt;
    添加学校
</div>
<!-- 导航栏结束 -->
<ul id="myTab" class="nav nav-tabs">
   <li>
         <a href="{:U('Admin/School/index')}">学校列表</a>
   </li>
   <li class="active">
       <a href="{:U('Admin/School/add')}">添加基本信息</a>
    </li>
</ul>

<form class="form-inline" method="post">
<div class="tabbable">
    <ul class="nav nav-tabs" id="myTab">
        <li class="active">
            <a data-toggle="tab" href="#home">
                <i class="green icon-home bigger-110"></i>
                基础信息
            </a>
        </li>

        <li class="">
            <a data-toggle="tab" href="#profile">
                设施相关
            </a>
        </li>

        <li class="">
            <a data-toggle="tab" href="#chengji">
                学校成绩
            </a>
        </li>

        <li class="">
            <a data-toggle="tab" href="#xuefeng">
                校风学风
            </a>
        </li>

        <li class="">
            <a data-toggle="tab" href="#fengge">
                学校成绩
            </a>
        </li>
    </ul>

    <div class="tab-content">
        <div id="home" class="tab-pane active">

                <table class="table table-striped table-bordered table-hover table-condensed">

                    <tr>
                        <th >学校名称</th>
                        <td>
                            <input class="form-control" type="text" name="schoolname">
                        </td>
                    </tr>
                    <tr>
                        <th>学校校区</th>
                        <td>
                            <select class="form-control" id="form-field-select-1" name="r_id">
                                <option value="0">请选择</option>
                                <foreach name="data" item="v">
                                    <option value="{$v['id']}">{$v['rname']}</option>
                                </foreach>
                            </select>
                        </td>
                    </tr>
                    <tr>
                        <th>学校类别</th>
                        <td>
                            <select class="form-control schoolcate" id="form-field-select-1 schoolcate" name="schoolcate" >
                                <option value="0">请选择</option>
                                <option value="1">小学</option>
                                <option value="2">中学</option>
                            </select>
                        </td>
                    </tr>
                    <tr>
                        <th>学校关联</th>
                        <td>
                            <span id="aa"></span>
                        </td>
                    </tr>
                </table>
        </div>

        <div id="profile" class="tab-pane">
            <script id="container" name="content[]" type="text/plain" ></script>
            <script src="__PUBLIC__/statics/ueditor1_4_3/ueditor.config.js"></script>
            <script src="__PUBLIC__/statics/ueditor1_4_3/ueditor.all.js"></script>
            <script>
                 UE.getEditor('container');
            </script>
        </div>

        <div id="chengji" class="tab-pane">
            <script id="container1" name="content[]" type="text/plain" style="width:100%"></script>
            <script>
                 UE.getEditor('container1');
            </script>
        </div>

        <div id="xuefeng" class="tab-pane">
            <script id="container2" name="content[]" type="text/plain" style="width:100%"></script>
            <script>
                UE.getEditor('container2');
            </script>
        </div>

        <div id="fengge" class="tab-pane">
            <script id="container3" name="content[]" type="text/plain" style="width:100%"></script>
            <script>
                UE.getEditor('container3');
            </script>
        </div>
    </div>
</div>

    <div style="margin:20px 0;"><input class="btn btn-success" type="submit" value="添加"></div>
</form>


<bootstrapjs />
<script src="__ADMIN_ACEADMIN__/js/chosen.jquery.min.js"></script>
<script>
    $(function(){

        $(".chosen-select").chosen();

        $('.schoolcate').change(function(){
            var schoolcate =  $('.schoolcate').val();
            postData = {"schoolcate":schoolcate};
            $(".schname").empty();
            $.ajax({
                type: "post",
                url: "{:U('Admin/School/showSchool')}",
                data:postData,
                success: function(data){
//                    alert($('.table tr').eq(3).children().next().html(data));
                    $("#aa").html(data);
                }
            })
        })
    });
</script>
<icheckjs color="blue" />
</body>
</html>